package game;

import java.io.BufferedWriter;
import java.io.StringWriter;
import java.util.HashMap;

import game.referenceValues.Skill;
import game.units.*;
import game.units.Character;

public class Main 
{	
	public static void main (String args[])
	{		
		
//		Character character = new Character();
//		character.setName("Cyro");
//		String armory = "armory";
//		HashMap<String, Skill> skills = new HashMap<String, Skill>();
//		skills.put(armory, new Skill(armory, "skill de teste"));
//		character.setSkillsMap(skills);
//		character.setSkill(armory, 5, 3);
//		character.skillTest(armory, 17);
		
		int posIni;
		int posEnd;
		
		String linha = "Shopping Center Iguatemi Londrina";
		String next = linha;
		String temp = linha.split(" ")[0];
		posEnd = linha.length();
		
		while (linha.length() > 20)
		{
			posIni = next.indexOf(" ");
			temp = temp + next.substring(posIni, posIni+2);
			posEnd = next.indexOf(" ", posIni+1);
			if(posEnd == -1)
			{
				posEnd = next.indexOf(temp);
				next = next.substring(posEnd+1, next.length());
				next = next.substring(0,20-temp.length());
			}
			else
			{				
				next =  next.substring(posEnd, next.length());
			}			
			linha = temp + next;
			System.out.println(linha.length());
		}
	}
		
}

